add<{extend name="public/base"}>
<{block name="foot_source"}>
<script type="text/javascript" src="/static/webuploader/webuploader.js"></script>
<link rel="stylesheet" type="text/css" href="/static/webuploader/webuploader.css">
<{/block}>
<{block name="content"}>
<!-- left column -->
<div class="col-md-12">
    <!-- general form elements -->
    <div class="box box-primary">
        <div class="box-header with-border">
            <h3 class="box-title"><{$title}></h3>
        </div>
        <!-- /.box-header -->
        <!-- form start -->
        <form role="form" action="<{:url('admin/style/handle')}>" method="post" id="form">
            <div class="box-body">
                <div class="form-group">
                    <label for="progress-list">更新进度<span id="status"></span></label>
                    <div class="form-control" id="progress-list" style="height:auto;min-height:30px;max-height:400px;overflow-y:scroll;">

                    </div>
                </div>

            </div>
            <!-- /.box-body -->
            <div class="form-group">
                <div class="box-body">
                    <div class="form-control" style="color:red;">如果无特殊情况 不要更新 确定平台地址数据有变动 才更新  预估时间30-60分钟 最近更新：<?php echo date('Y-m-d H:i',$model['update_time']); ?> </div>
                </div>
            </div>
            <div class="box-footer">
                <a href="javascript:;" type="submit" class="btn btn-primary" id="submit">开始更新公司数据</a>
            </div>
        </form>
    </div>
    <!-- /.box -->
</div>


<{/block}>
<{block name="foot_script"}>
<script type="text/javascript">
    $(function(){
        $("#submit").click(function(){
            updateCompany();
        });

        function updateCompany(){
            $.post("/admin/busapi/updateCompany",function(data){
                if(data.code == 1){
                    $("#progress-list").prepend("<div style='color:green;'>"+data.msg+"</div>");
                    updateCompany();
                }else{
                    $("#progress-list").prepend("<div style='color:red;'>"+data.msg+"</div>");
                }
            });
        }
    });
</script>
<{/block}>


